package gof.com.yew.proxy.staticproxy;

import java.util.Random;

public class AudiCarTimeProxy implements Movable {
	
	private Movable thing;
	
	public AudiCarTimeProxy(Movable thing) {
		this.thing = thing;
	}
	
	@Override
	public void move() {
		long start = System.currentTimeMillis();
		System.out.println("AudiCarTimeProxy move start ");
		try {
			Thread.sleep(new Random().nextInt(1000));
		} catch (InterruptedException e) {
		System.out.println("run exception");
		}
		thing.move();
		long end  = System.currentTimeMillis();
		System.out.println("AudiCarTimeProxy move end ");
		System.out.println("callback move 耗时为："+(end-start)+"ms");
	}

}
